package com.socket.test1;

import java.io.*;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by buguniao on 16/4/11.
 */
public class Server {
    public static void main(String[] args) throws IOException {
        ServerSocket server = new ServerSocket(8080);
        Socket socket = null;

        while((socket = server.accept())!=null){
            Reader reader = new InputStreamReader(socket.getInputStream());
            int i =-1;
            while(true){
                System.out.print(reader.read());
            }
//            reader.close();
//            socket.close();
        }
    }
}
